package com.weseal.enums;

/**
 * @author weseal
 * @title
 * @description
 * @usage
 * @copyright Copyright 2014  rrmj Corporation. All rights reserved.
 * @company 上海众多美网络科技有限公司
 * @create 2017/9/10
 */
public enum MasterType implements BaseEnum<MasterType, Integer> {
	SUPER(1, "超级管理员"),
	ADMIN(2, "管理员"),
	ASSISTANT(3, "助理");

	private int code;
	private String message;

	MasterType(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public static MasterType getByCode(int code) {
		for (MasterType type : MasterType.values()) {
			if (type.getCode().equals(code)) {
				return type;
			}
		}
		return null;
	}

	@Override
	public Integer getCode() {
		return this.code;
	}

	@Override
	public String getMessage() {
		return this.message;
	}
}
